/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "StyleWaterProfiles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StyleWaterProfiles.findAll", query = "SELECT s FROM StyleWaterProfiles s ORDER BY s.cityName ASC"),
    @NamedQuery(name = "StyleWaterProfiles.findByProfileID", query = "SELECT s FROM StyleWaterProfiles s WHERE s.profileID = :profileID"),
    @NamedQuery(name = "StyleWaterProfiles.findByCityName", query = "SELECT s FROM StyleWaterProfiles s WHERE s.cityName = :cityName"),
    @NamedQuery(name = "StyleWaterProfiles.findByCountryName", query = "SELECT s FROM StyleWaterProfiles s WHERE s.countryName = :countryName"),
    @NamedQuery(name = "StyleWaterProfiles.findByCa", query = "SELECT s FROM StyleWaterProfiles s WHERE s.ca = :ca"),
    @NamedQuery(name = "StyleWaterProfiles.findByMg", query = "SELECT s FROM StyleWaterProfiles s WHERE s.mg = :mg"),
    @NamedQuery(name = "StyleWaterProfiles.findByNa", query = "SELECT s FROM StyleWaterProfiles s WHERE s.na = :na"),
    @NamedQuery(name = "StyleWaterProfiles.findByCl", query = "SELECT s FROM StyleWaterProfiles s WHERE s.cl = :cl"),
    @NamedQuery(name = "StyleWaterProfiles.findBySo4", query = "SELECT s FROM StyleWaterProfiles s WHERE s.so4 = :so4"),
    @NamedQuery(name = "StyleWaterProfiles.findByCo3", query = "SELECT s FROM StyleWaterProfiles s WHERE s.co3 = :co3"),
    @NamedQuery(name = "StyleWaterProfiles.findByPH", query = "SELECT s FROM StyleWaterProfiles s WHERE s.pH = :pH")})
public class StyleWaterProfiles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "profileID")
    private Integer profileID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 50)
    @Column(name = "cityName")
    private String cityName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 50)
    @Column(name = "countryName")
    private String countryName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ca")
    private float ca;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mg")
    private float mg;
    @Basic(optional = false)
    @NotNull
    @Column(name = "na")
    private float na;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cl")
    private float cl;
    @Basic(optional = false)
    @NotNull
    @Column(name = "so4")
    private float so4;
    @Basic(optional = false)
    @NotNull
    @Column(name = "co3")
    private float co3;
    @Basic(optional = false)
    @NotNull
    @Column(name = "pH")
    private float pH;
    @OneToMany(mappedBy = "profileID")
    private Collection<RecipeSalts> recipeSaltsCollection;

    public StyleWaterProfiles() {
    }

    public StyleWaterProfiles(Integer profileID) {
        this.profileID = profileID;
    }

    public StyleWaterProfiles(Integer profileID, String cityName, String countryName, float ca, float mg, float na, float cl, float so4, float co3, float pH) {
        this.profileID = profileID;
        this.cityName = cityName;
        this.countryName = countryName;
        this.ca = ca;
        this.mg = mg;
        this.na = na;
        this.cl = cl;
        this.so4 = so4;
        this.co3 = co3;
        this.pH = pH;
    }

    public Integer getProfileID() {
        return profileID;
    }

    public void setProfileID(Integer profileID) {
        this.profileID = profileID;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCountryName() {
        return countryName;
    }

    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }

    public float getCa() {
        return ca;
    }

    public void setCa(float ca) {
        this.ca = ca;
    }

    public float getMg() {
        return mg;
    }

    public void setMg(float mg) {
        this.mg = mg;
    }

    public float getNa() {
        return na;
    }

    public void setNa(float na) {
        this.na = na;
    }

    public float getCl() {
        return cl;
    }

    public void setCl(float cl) {
        this.cl = cl;
    }

    public float getSo4() {
        return so4;
    }

    public void setSo4(float so4) {
        this.so4 = so4;
    }

    public float getCo3() {
        return co3;
    }

    public void setCo3(float co3) {
        this.co3 = co3;
    }

    public float getPH() {
        return pH;
    }

    public void setPH(float pH) {
        this.pH = pH;
    }

    @XmlTransient
    public Collection<RecipeSalts> getRecipeSaltsCollection() {
        return recipeSaltsCollection;
    }

    public void setRecipeSaltsCollection(Collection<RecipeSalts> recipeSaltsCollection) {
        this.recipeSaltsCollection = recipeSaltsCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (profileID != null ? profileID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StyleWaterProfiles)) {
            return false;
        }
        StyleWaterProfiles other = (StyleWaterProfiles) object;
        if ((this.profileID == null && other.profileID != null) || (this.profileID != null && !this.profileID.equals(other.profileID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.StyleWaterProfiles[ profileID=" + profileID + " ]";
    }
    
}
